home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / STRINGS / PACKAGE6 / READ_STR.DOC < prev    next >
Text File  |  1990-07-25  |  2KB  |  45 lines

  1. -----------------------------------------------------------------------------
  2. ReadlnString
  3. -----------------------------------------------------------------------------
  4.  
  5. declaration:    procedure ReadlnString ( var AString:
  6.                                                TypeString;
  7.                                              StringLength:
  8.                                                integer;
  9.                                          var LastKey:
  10.                                                TypeKey);
  11.  
  12. purpose:        To read from the input a string of characters and to put in a
  13.                 packed array. Length shall be = to the number of elements in
  14.                 the array
  15.  
  16. preconditions:  AString delcared.  0 <= StringLength <= MaxStringLength.
  17.                 LastKey is declared.
  18.  
  19. postconditions: AString Filled with either an empty set if escape is the last
  20.                 key pressed, or with the contents entered by the user, if
  21.                 Return is the last key pressed
  22.  
  23. special cases:  The user presses enter with out entering anything.  The user
  24.                 presses backspace while nothing is in the screen.  The user
  25.                 tries to add more characters than will be allowed.
  26.  
  27. example:        var
  28.                   AString:
  29.                     TypeString;
  30.                   LastKey:
  31.                     TypeKey;
  32.  
  33.                 begin
  34.                   .
  35.                   .
  36.                   .
  37.                   write(output,'Enter your name: ');
  38.                   ReadlnString(AString,34,LastKey);
  39.                   .
  40.                   .
  41.                   .
  42.                 end
  43.  
  44. -----------------------------------------------------------------------------
  45.